package com.lantosec.hmrp.modules.warning.vo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.lantosec.hmrp.core.mvc.BaseVO;
import com.lantosec.hmrp.modules.eval.entity.EvalItem;
import com.lantosec.hmrp.modules.warning.entity.WarningData;
import com.lantosec.hmrp.modules.warning.entity.WarningEvalNote;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;
import java.util.List;

/**
 * <p>
 * 预警数据 VO对象
 * </p>
 *
 * @author AutoCode
 * @since 2020-05-27
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel(value="WarningData对象", description="预警数据")
public class WarningDataVO extends BaseVO<WarningData> {
    private static final long serialVersionUID = 1L;


    public WarningDataVO(WarningData entity){
        this.dataId = entity.getDataId();
        this.ruleId = entity.getRuleId();
        this.runTime = entity.getRunTime();
        this.dataTime = entity.getDataTime();
        this.content = entity.getContent();
        this.thresholdContent = entity.getThresholdContent();
        this.handleUserId = entity.getHandleUserId();
        this.handleUser = entity.getHandleUser();
        this.handleTime = entity.getHandleTime();
        this.handleRemark = entity.getHandleRemark();
        this.reportedUserId = entity.getReportedUserId();
        this.reportedUser = entity.getReportedUser();
        this.reportedTime = entity.getReportedTime();
        this.reportedRemark = entity.getReportedRemark();
        this.violateFlag = entity.getViolateFlag();
        this.handleState = entity.getHandleState();
        this.repeatFilterContent = entity.getRepeatFilterContent();
        this.startDate = entity.getStartDate();
        this.endDate = entity.getEndDate();
        this.tableDefine = entity.getTableDefine();
        this.warningRuleEvals = entity.getWarningRuleEvals();
        this.warningEvalNotes = entity.getWarningEvalNotes();
    }

    @Override
    public WarningData convertToEntity(){
        return new WarningData(this);
    }


    @ApiModelProperty(value = "预警数据ID")
    @TableId(value = "data_id", type = IdType.AUTO)
    private Integer dataId;

    @ApiModelProperty(value = "预警规则")
    private String ruleId;

    @ApiModelProperty(value = "预警运行时间")
    private String runTime;

    @ApiModelProperty(value = "预警数据时间(从数据源中指定时间字段)")
    private String dataTime;

    @ApiModelProperty(value = "预警运行的数据内容")
    private String content;

    @ApiModelProperty(value = "重置数据内容")
    private String thresholdContent;

    @ApiModelProperty(value = "处置人ID")
    private String handleUserId;

    @ApiModelProperty(value = "处置人")
    private String handleUser;

    @ApiModelProperty(value = "处置时间")
    private Date handleTime;

    @ApiModelProperty(value = "处置说明")
    private String handleRemark;

    @ApiModelProperty(value = "上报接收人ID")
    private String reportedUserId;

    @ApiModelProperty(value = "上报接收人")
    private String reportedUser;

    @ApiModelProperty(value = "上报时间")
    private Date reportedTime;

    @ApiModelProperty(value = "上报处理意见")
    private String reportedRemark;

    @ApiModelProperty(value = "是否违规")
    private Integer violateFlag;

    @ApiModelProperty(value = "处置状态(0待处置 1待审批 2处置驳回 3已处置)")
    private Integer handleState;

    @ApiModelProperty(value = "重复过滤字段数据内容")
    private String repeatFilterContent;

    @ApiModelProperty(value = "开始时间")
    @TableField(exist = false)
    private String startDate;

    @ApiModelProperty(value = "结束时间")
    @TableField(exist = false)
    private String endDate;

    @ApiModelProperty(value = "预警数据表格定义")
    @TableField(exist = false)
    private String tableDefine;

    @ApiModelProperty(value = "预警处置标准")
    @TableField(exist = false)
    private List<EvalItem> warningRuleEvals;

    @ApiModelProperty(value = "处置奖惩记录")
    @TableField(exist = false)
    private List<WarningEvalNote> warningEvalNotes;


}
